business-value-ux
TMF 679 POST - Product Offering Qualification
Evaluates promotional coupon eligibility for a customer based on profile attributes and transaction context. Triggered when category.name == "couponEligibility" for a BANCAN or MSISDN (either of them are required to identify the account)
URL
https://[localhost]:[port]/business-value-ux/v1/{businessId}/productOfferingQualification/productOfferingQualificationurl Param
| name | type | description | required |
|---|---|---|---|
| businessId | string | 2 letter ISO 3166 country code (TT, BB, JM, PA, etc.) identifying the business unit. | Y |
Header
| name | type | description | required |
|---|---|---|---|
| client_id | string | The client_id identifying the channel. Minimum characters: 5 | Y |
| client_secret | string | Password associated with the client_id. Minimum characters: 5 | Y |
| X-Correlation-ID | string | Identifier that correlates HTTP request between a client and server. Any identification model (UUDI, checksum, etc.) can be used, as long as it is a unique value to differentiate a transaction. | Y |
Request to check Coupon Eligibility:
curl --location --request POST 'https://nonprod.esb.cloud.lla.com/dev/business-value-ux/v1/PR/productOfferingQualification/productOfferingQualification' \
--header 'client_id: xxxx' \
--header 'client_secret: xxxx' \
--header 'X-Correlation-ID: {guid}' \
--header 'Content-Type: application/json' \
--data-raw '{
"category": {
"name": "couponEligibility"
},
"channel": {
"id": "USSD",
"name": "USSD",
"@type": "ChannelRef"
},
"productOfferingQualificationItem": [
{
"id": "1",
"product": {
"billingAccount": {
"id": "BAN-123456"
},
"realizingResource": [
{
"id": "18765551234",
"name": "msisdn"
}
],
"productPrice": [
{
"priceType": "rechargeAmount",
"price": {
"dutyFreeAmount": {
"value": 10.00
}
}
}
],
"productCharacteristic": [
{
"name": "coupon_tags",
"value": [
"recharge",
"loyalty"
]
},
{
"name": "last_recharge_channel",
"value": "B2C"
},
{
"name": "plan_type",
"value": "prepaid"
},
{
"name": "balance",
"value": "12.50"
}
],
"@type": "Product"
},
"@type": "ProductOfferingQualificationItem"
}
],
"@type": "ProductOfferingQualification"
}'Definitions
Each of the request parameters is detailed.
| name | type | description | required |
|---|---|---|---|
| category.name | string | Static label identifying the operation. Expected value: "couponEligibility" | Y |
| channel | object | Channel through which the transaction originates | Y |
| channel.id | string | Channel id. Example: "USSD" | Y |
| channel.name | string | Channel name. Example: "USSD" | Y |
| channel.@type | string | Static value: "ChannelRef" | Y |
| productOfferingQualificationItem | array | List of qualification items. One item per evaluation request. | Y |
| productOfferingQualificationItem[].id | string | Sequence identifier for the item. Example: "1" | Y |
| productOfferingQualificationItem[].product | object | Customer product/line details | Y |
| productOfferingQualificationItem[].product.billingAccount | object | Billing account for the customer | Y* |
| productOfferingQualificationItem[].product.billingAccount.id | string | Customer Billing Account Number (BAN). Example: "BAN-123456" | Y* |
| productOfferingQualificationItem[].product.realizingResource | object | Resource realizing the product (MSISDN) | Y* |
| productOfferingQualificationItem[].product.realizingResource.id | string | MSISDN of the line. Example: "18765551234" | Y* |
| productOfferingQualificationItem[].product.realizingResource.name | string | Static value: "msisdn" | Y* |
| productOfferingQualificationItem[].product.productPrice | array | Device pricing details | O |
| productOfferingQualificationItem[].product.productPrice[priceType=rechargeAmount].price.dutyFreeAmount.value | number | Recharge Amount. | O |
| productOfferingQualificationItem[].product.productCharacteristic | array | Additional customer and transaction attributes used for rule evaluation | O |
| productOfferingQualificationItem[].product.productCharacteristic[name=coupon_tags].value | array | Tags used for coupon matching. Maps to coupon_tags. Example: ["recharge","loyalty"] | O |
| productOfferingQualificationItem[].product.productCharacteristic[name=last_recharge_channel].value | string | Last Channel to Recharge | O |
| productOfferingQualificationItem[].product.productCharacteristic[name=plan_type].value | string | Type of plan. e.g. prepaid | O |
| productOfferingQualificationItem[].product.productCharacteristic[name=balance].value | string | Balance of the account | O |
| productOfferingQualificationItem[].product.@type | string | Static value: "Product" | Y |
| productOfferingQualificationItem[].@type | string | Static value: "ProductOfferingQualificationItem" | Y |
| @type | string | Static value: "ProductOfferingQualification" | Y |
Response
{
"@type": "ProductOfferingQualification",
"productOfferingQualificationItem": [
{
"id": "1",
"state": "done",
"qualificationItemResult": "eligible",
"productOffering": {
"id": "CPN031",
"name": "Loyalty $10 credits on MRC Recharge",
"@type": "ProductOfferingRef"
},
"product": {
"productTerm": [
{
"name": "promotionTerm",
"duration": {
"amount": 36,
"units": "months"
},
"validFor": {
"startDateTime": "2019-03-15T10:30:21.000Z",
"endDateTime": "2020-03-15T10:30:21.000Z"
},
"@type": "ProductTerm"
}
],
"productPrice": [
{
"priceType": "discountValue",
"price": {
"dutyFreeAmount": {
"value": 10.00
}
}
}
],
"billingAccount": {
"id": "BAN-123456"
},
"realizingResource": [
{
"id": "18765551234",
"name": "msisdn"
}
],
"productCharacteristic": [
{
"name": "discount_type",
"value": "fixed_amount"
},
{
"name": "max_redemptions_per_entity",
"value": 1
},
{
"name": "priority",
"value": 100
},
{
"name": "exclusion_group",
"value": null
},
{
"name": "correlation_id",
"value": "ENGINE-7f3a9bc2-CPN-DEVICE-200OFF"
},
{
"name": "applies_to",
"value": ""
},
{
"name": "name_es",
"value": "Descuento Cliente Leal $200"
},
{
"name": "sub_type",
"value": null
},
{
"name": "promotion_type",
"value": "Discount"
},
{
"name": "evaluation_ms",
"value": "12.34"
},
{
"name": "tier_info",
"value": null
},
{
"name": "rule",
"value": {
"id": "R-001",
"name": "Rule 001"
}
},
{
"name": "condition_trace",
"value": []
}
],
"@type": "Product"
},
"@type": "ProductOfferingQualificationItem"
},
{
"id": "2",
"state": "done",
"qualificationItemResult": "notEligible",
"productOffering": {
"id": "CPN010",
"name": "VIP $50 Off",
"@type": "ProductOfferingRef"
},
"product": {
"billingAccount": {
"id": "BAN-123456"
},
"realizingResource": [
{
"id": "18765551234",
"name": "msisdn"
}
],
"productCharacteristic": [
{
"name": "evaluation_ms",
"value": "12.34"
}
]
},
"eligibilityUnavailabilityReason": [
{
"code": "Redemption limit reached",
"label": "Already redeemed (1/1)"
}
],
"@type": "ProductOfferingQualificationItem"
}
]
}Definitions
Each of the response parameters is detailed.
| name | type | description |
|---|---|---|
| @type | string | Static value: "ProductOfferingQualification" |
| productOfferingQualificationItem | array | List of qualification results — one entry per eligible coupon plus one per rejected coupon |
| productOfferingQualificationItem[].id | string | Sequential item identifier |
| productOfferingQualificationItem[].state | string | Evaluation state. Static value: "done" |
| productOfferingQualificationItem[].qualificationItemResult | string | Eligibility result. Values: "eligible" or "notEligible" |
| productOfferingQualificationItem[].productOffering.id | string | Coupon ID. Example: "CPN-DEVICE-200OFF" |
| productOfferingQualificationItem[].productOffering.name | string | Coupon name. Example: "Loyal Customer $200 Off" |
| productOfferingQualificationItem[].productOffering.@type | string | Static value: "ProductOfferingRef" |
| productOfferingQualificationItem[].product.productTerm[].name | string | Identifier of the promotion |
| productOfferingQualificationItem[].product.productTerm[].duration.amount | integer | Promotion term in units defined. Example: 36 |
| productOfferingQualificationItem[].product.productTerm[].duration.units | string | Units of Promotion amount. Example: "months" |
| productOfferingQualificationItem[].product.productTerm[].validFor.startDateTime | string | Promotion validity start. |
| productOfferingQualificationItem[].product.productTerm[].validFor.endDateTime | string | Promotion validity end. |
| productOfferingQualificationItem[].product.productTerm[].validFor.@type | string | Static value: "ProductTerm" |
| productOfferingQualificationItem[].product.productPrice[priceType=discountValue].price.dutyFreeAmount.value | string | Discount value. Example: 200.00 |
| productOfferingQualificationItem[].product.billingAccount.id | string | Customer BAN. |
| productOfferingQualificationItem[].product.realizingResource.id | string | value of MSISDN. |
| productOfferingQualificationItem[].product.realizingResource.name | string | MSISDN. |
| productOfferingQualificationItem[].product.productCharacteristic[discount_type].value | string | Type of discount |
| productOfferingQualificationItem[].product.productCharacteristic[max_redemptions_per_entity].value | integer | Max times this coupon can be redeemed per customer |
| productOfferingQualificationItem[].product.productCharacteristic[priority].value | integer | Display priority |
| productOfferingQualificationItem[].product.productCharacteristic[exclusion_group].value | string | Mutual exclusion group |
| productOfferingQualificationItem[].product.productCharacteristic[correlation_id].value | string | Engine-generated unique ID for this coupon evaluation. |
| productOfferingQualificationItem[].product.productCharacteristic[applies_to].value | string | What the promotion applies to. |
| productOfferingQualificationItem[].product.productCharacteristic[name_es].value | string | Promotion name in Spanish. |
| productOfferingQualificationItem[].product.productCharacteristic[sub_type].value | string | Promotion sub-category. |
| productOfferingQualificationItem[].product.productCharacteristic[promotion_type].value | string | General promotion category. |
| productOfferingQualificationItem[].product.productCharacteristic[evaluation_ms].value | string | Time taken to evaluate (milliseconds). |
| productOfferingQualificationItem[].product.productCharacteristic[tier_info].value | string | Info of the tier |
| productOfferingQualificationItem[].product.productCharacteristic[rule].value.id | string | Rule Id |
| productOfferingQualificationItem[].product.productCharacteristic[rule].value.name | string | Rule Name |
| productOfferingQualificationItem[].product.productCharacteristic[condition_trace].value | array | array of evaluated conditions |
| productOfferingQualificationItem[].product.@type | array | Static value: "Product" |
| productOfferingQualificationItem[].@type | array | Static value: "ProductOfferingQualificationItem" |
| productOfferingQualificationItem[].eligibilityUnavailabilityReason[].code | string | Failed condition detail (rejected only). Maps from rejected_coupons[].failed_conditions[0] |
| productOfferingQualificationItem[].eligibilityUnavailabilityReason[].label | string | Human-readable rejection reason. Maps from rejected_coupons[].reason |
Possible response error
In this section all the possible data structures received by the client are defined and that must be considered as unsatisfactory when responding to the method.
[ 400 ]
Bad Request - the request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications.
{
"errors" : [{
"code" : 400,
"message" : "The request is invalid or not properly formed.",
"description" : "Malformed request syntax, invalid request message framing, or deceptive request routing."
}]
}[ 401 ]
Unauthorized - The request has not been applied because it lacks valid authentication credentials for the target resource.
{
"errors" : [{
"code" : 401,
"message" : "The user could not be authenticated for this request.",
"description" : "The request has not been applied because it lacks valid authentication credentials for the target resource."
}]
}[ 404 ]
Not Found - server has not found a resource with that URI. This may be temporary and permanent condition. This status code is commonly used when the server does not wish to reveal exactly why the request has been refused, or when no other response is applicable.
{
"errors" : [{
"code" : 404,
"message" : "The server could not find the requested resource.",
"description" : "The requested operation failed because a resource associated with the request could not be found."
}]
}[ 405 ]
Method Not Allowed - HTTP method not allowed for this resource. The method specified in the Request-Line is not allowed for the resource identified by the Request-URI.
{
"errors": [{
"code": 405,
"message": "APIKIT:METHOD_NOT_ALLOWED",
"description": "HTTP Method PATCH not allowed for : /{businessId}/productOfferingQualification/productOfferingQualification"
}]
}[ 500 ]
Internal Server Error - server encountered an error processing request. This should not happen normally, but it is a generic error message, given when no more specific message is suitable.
{
"errors" : [{
"code" : 500,
"message" : "Internal Server Error",
"description": "The request failed due to an internal error."
}]
}[ 501 ]
Not implemented - indicates that the server does not support the functionality required to fulfill the request. This is the appropriate response when the server does not recognize the request method and is not capable of supporting it for any resource.
{
"errors" : [{
"code" : 501,
"message" : "Not implemented",
"description" : "Operation GET /productOfferingQualification/productOfferingQualification for Business Id: xxxx not implemented"
}]
}#####